home *** CD-ROM | disk | FTP | other *** search
- /* HTuple.h by Paul Kunz December 1991
- * Object used to store information on open Hippo Tuple and methods
- * to archive it to NXTypedStream.
- *
- * $Id: HTuple.h,v 1.6 1992/04/13 20:43:55 pfkeb Rel $
- *
- * Copyright (C) 1991 The Board of Trustees of
- * The Leland Stanford Junior University. All Rights Reserved.
- */
-
- #import <objc/Object.h>
-
- #import <stdio.h>
- #import "hippo.h"
-
- @interface HTuple:Object
- {
- ntuple tuple; /* The tuple */
- char *filename; /* filename of ntuple */
- int ntindex; /* index of tuple in file */
- char *altfilename; /* alternate filename of ntuple */
- BOOL isRef; /* Import by reference or not */
- BOOL isBinary; /* file was binary or not */
- BOOL fakeFilename; /* set YES if n-tuple is not from file */
- }
- + initialize;
- /*
- * Initializer for class. Sets up the class version number
- */
-
- - initTuple:(ntuple) nt file:(const char *)path
- by:(BOOL)refFlag mode:(BOOL) binFlag index:(int) iValue;
- /*
- * Designated initalizer fro HTuple object.
- */
-
- - (ntuple) ntuple;
- /*
- * Returns the ntuple managed by the receiving object.
- */
-
- - setNtuple:(ntuple) aTuple;
- /*
- * Sets the ntuple to be managed by the receiving object.
- */
-
- - (BOOL) isRef;
- /*
- * Returns YES if ntuple is imported by reference, or NO otherwise.
- */
-
- - setIsRef:(BOOL) refFlag;
- /*
- * Sets the reference state of the ntuple managed by receiving object.
- */
-
- - (BOOL) isSameAs:aTuple;
- /*
- * The receiving object compares its self with aTuple and returns
- * YES if both objects refer to the same ntuple.
- */
-
- - setIsBinary:(BOOL) binFlag;
- /*
- * Sets the mode by which the ntuple was read from disk to binary,
- * binFlag = YES, or text, binFlag = NO.
- */
-
- - (const char *)filename;
- /*
- * Returns the file name of the ntuple managed by the receiving object.
- */
-
- - setFilename:(const char *)path;
- /*
- * Sets the filename path name of the ntuple managed by the receiving object.
- */
-
- - (int) index;
- /*
- * Returns the index number of n-tuple in a file of multiple n-tuples.
- */
-
- - setIndex:(int) value;
- /*
- * Sets the index number of n-tuple in a file of multiple n-tuples.
- */
-
- - (const char *)altfilename;
- /*
- * Returns the alternate file name of the ntuple managed
- * by the receiving object. In cases where the object was archived
- * by reference with one file name, but upon dearchiving another
- * filename was prompted for and used, then the alternate filename
- * is the original filename.
- */
-
- - setAltFilename:(const char *)path;
- /*
- * Sets the alternate filename path name of the ntuple managed
- * by the receiving object. See - (const char *)altfilename.
- */
-
- - (BOOL) isFakeFilename;
- /*
- * Returns YES if the filename is a fake one.
- */
-
- - setFakeFilename:(BOOL) bValue;
- /*
- * Sets the status of the filename. The filename is considered "fake"
- * if the n-tuple was not read from a file, e.g. was copied from Pasteboard
- * or generated by the application.
- */
-
- - (const char *) title;
- /*
- * Returns the title of the tuple if it is open, else non available
- * message.
- */
-
- - write:(NXTypedStream *) stream;
- /*
- * Archives the receiving object to the NXTypedStream stream. If
- * the ntuple managed by the receiving object is imported by copy,
- * then the ntuple is archived as well
- */
-
- - read:(NXTypedStream *) stream;
- /*
- * Dearchives the receiving object from the NXTypedStream stream. If
- * the ntuple managed by the receiving object is imported by copy,
- * then the ntuple is dearchived as well.
- */
-
- - free;
- /*
- * Frees all memory contained by the receiving object and
- * frees the object itself.
- */
-
- @end
-